package core.util;

import java.util.concurrent.atomic.AtomicInteger;

public class ResponseCounter {
	// 2 seconds for time out
	public static final int TIME_OUT_DURATION = 2000;

	private AtomicInteger counter = new AtomicInteger();

	private long callTime = System.currentTimeMillis();

	private Locations locations;

	public ResponseCounter() {
		this.locations = new Locations();
	}

	public long getFirstCallTime() {
		return callTime;
	}

	public void incrementCounter() {
		counter.incrementAndGet();
	}

	public int getCount() {
		return counter.get();
	}

	public void addLocation(String serverId) {
		this.locations.add(serverId);
	}

	public Locations getLocations() {
		return locations;
	}
}
